package com.sdkj.recruit.service.impl;

import java.util.HashMap;
import java.util.Map;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.sdkj.recruit.service.ImopService;
import com.sdkj.recruit.util.HttpAccessUtil;
import com.sdkj.recruit.util.PropertiesUtil;

/**
 * mop 短信验证
 * 
 * @author shenxiaozhong
 *
 */
@Service
public class MopService implements ImopService {

	private static Logger log = Logger.getLogger(MopService.class);

	private static PropertiesUtil propertiesUtil = new PropertiesUtil("config.properties");

	@Override
	public String verify(String appkey, String phone, String zone, String code) {

		String url = propertiesUtil.getProperty("mobverify");
		log.info("获取verifyUrl:" + url);
		Map<String, String> paramMap = new HashMap<String, String>();
		paramMap.put("appkey", appkey);
		paramMap.put("phone", phone);
		paramMap.put("zone", zone);
		paramMap.put("code", code);
		String result = HttpAccessUtil.httpPostSSL(url, paramMap);
		log.info("获取verifyUrl:" + result);
		return result;
	}
}
